2004-03-10 Morten Welinder <terra@gnome.org>
+ * gtk/gtkfilechooserdefault.c
+ (gtk_file_chooser_default_add_shortcut_folder): Test validity of
+ path here.
+ (shortcuts_insert_path): Don't check here.
+ (get_file_info): Barf if name-only fails.
+
* tests/testfilechooser.c (main): Add support for --multiple.
Wed Mar 10 02:41:05 2004 Jonathan Blandford <jrb@gnome.org>
2004-03-10 Morten Welinder <terra@gnome.org>
+ * gtk/gtkfilechooserdefault.c
+ (gtk_file_chooser_default_add_shortcut_folder): Test validity of
+ path here.
+ (shortcuts_insert_path): Don't check here.
+ (get_file_info): Barf if name-only fails.
+
* tests/testfilechooser.c (main): Add support for --multiple.
Wed Mar 10 02:41:05 2004 Jonathan Blandford <jrb@gnome.org>
2004-03-10 Morten Welinder <terra@gnome.org>
+ * gtk/gtkfilechooserdefault.c
+ (gtk_file_chooser_default_add_shortcut_folder): Test validity of
+ path here.
+ (shortcuts_insert_path): Don't check here.
+ (get_file_info): Barf if name-only fails.
+
* tests/testfilechooser.c (main): Add support for --multiple.
Wed Mar 10 02:41:05 2004 Jonathan Blandford <jrb@gnome.org>
2004-03-10 Morten Welinder <terra@gnome.org>
+ * gtk/gtkfilechooserdefault.c
+ (gtk_file_chooser_default_add_shortcut_folder): Test validity of
+ path here.
+ (shortcuts_insert_path): Don't check here.
+ (get_file_info): Barf if name-only fails.
+
* tests/testfilechooser.c (main): Add support for --multiple.
Wed Mar 10 02:41:05 2004 Jonathan Blandford <jrb@gnome.org>
2004-03-10 Morten Welinder <terra@gnome.org>
+ * gtk/gtkfilechooserdefault.c
+ (gtk_file_chooser_default_add_shortcut_folder): Test validity of
+ path here.
+ (shortcuts_insert_path): Don't check here.
+ (get_file_info): Barf if name-only fails.
+
* tests/testfilechooser.c (main): Add support for --multiple.
Wed Mar 10 02:41:05 2004 Jonathan Blandford <jrb@gnome.org>
GtkFileFolder *parent_folder;
GtkFileInfo *info;
- info = NULL;
-
if (!gtk_file_system_get_parent (file_system, path, &parent_path, error))
return NULL;
error);
gtk_file_path_free (parent_path);
- if (!parent_folder)
- return NULL;
-
- info = gtk_file_folder_get_info (parent_folder, path, error);
- g_object_unref (parent_folder);
+ if (parent_folder)
+ {
+ info = gtk_file_folder_get_info (parent_folder, path, error);
+ g_object_unref (parent_folder);
+ }
+ else
+ {
+ info = NULL;
+ /* Name-only should not fail. */
+ g_return_val_if_fail (!name_only, NULL);
+ }
return info;
}
}
else
{
- /* Always check to make sure that the directory exists. */
- GtkFileInfo *info = get_file_info (impl->file_system, path, FALSE, error);
- if (info == NULL)
- return FALSE;
-
if (label)
label_copy = g_strdup (label);
else
- label_copy = g_strdup (gtk_file_info_get_display_name (info));
-
- gtk_file_info_free (info);
+ {
+ GtkFileInfo *info = get_file_info (impl->file_system, path, TRUE, error);
+ label_copy = g_strdup (gtk_file_info_get_display_name (info));
+ gtk_file_info_free (info);
+ }
data = gtk_file_path_copy (path);
pixbuf = gtk_file_system_render_icon (impl->file_system, path, GTK_WIDGET (impl),
{
GtkFileChooserDefault *impl = GTK_FILE_CHOOSER_DEFAULT (chooser);
gboolean result;
+ GtkFileInfo *info;
int pos;
+ /* Test validity of path here. */
+ info = get_file_info (impl->file_system, path, FALSE, error);
+ if (!info)
+ return FALSE;
+ gtk_file_info_free (info);
+
pos = shortcuts_get_pos_for_shortcut_folder (impl, impl->num_shortcuts);
result = shortcuts_insert_path (impl, pos, FALSE, NULL, path, NULL, FALSE, error);